<?php

namespace app\admin\model;

use think\Model;

/**
 * 订阅记录
 * Class SubscribeLog
 * @package app\admin\model
 */
class SubscribeLog extends Model
{
    /**
     * 指定订阅记录
     * @param $where
     * @return array
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public static function findSubscribeLog($where)
    {
        $info = self::where($where)->find();

        return $info ? $info->toArray() : [];
    }

    /**
     * 更新订阅记录
     * @param $where
     * @param $data
     * @return SubscribeLog
     */
    public static function updateSubscribeLog($where, $data)
    {
        return self::update($data, $where);
    }
}